package com.javaGame.role.enemy;

import com.javaGame.frame.MainFrame;
import com.javaGame.role.Bomb;
import com.javaGame.role.enemyBullet.StarBullet;
import com.javaGame.util.ImageChange;

import java.awt.*;

/**
 * Boss类
 */
public class Boss extends EnemyRole{
    /*boss图片数组*/
    public static Image[] bossImg;
    /**图片切换对象*/
    private ImageChange imageChange = new ImageChange(3);
    /**子弹发射计数器*/
    private int bulletCount;
    public Boss() {
        super(750, 100, 260, 220,10000,20000);
    }

    @Override
    public void move() {
        this.currentImg = imageChange.change(bossImg);

        bulletCount ++;
        if(bulletCount > 100){
            bulletCount = 0;
            MainFrame.roleList.add(new StarBullet(x,y));
            MainFrame.roleList.add(new StarBullet(x,y+50));
            MainFrame.roleList.add(new StarBullet(x,y+100));
            MainFrame.roleList.add(new StarBullet(x,y+150));
            MainFrame.roleList.add(new StarBullet(x,y+200));
        }
    }

    public void addBomb(){
        MainFrame.isRun = false;
        MainFrame.isPass = true;
    }
}
